home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 8: LINUX Games / Linux Cubed Series 8 - LINUX Games.iso / games / fortune-.tar / fortune- / fortune / Makefile < prev    next >
Makefile  |  1995-10-20  |  4KB  |  153 lines

  1. CFLAGS=-O2 -Wall -fomit-frame-pointer -pipe
  2. LDFLAGS=-s
  3.  
  4. # The above flags are used by default; the debug flags are used when make
  5. # is called with 'make debug'
  6.  
  7. # to get a list of the possible targets, try 'make help'
  8.  
  9. # All targets are available at the top level, which exports the
  10. # variables to sub-makes.  Avoid makes in subdirectories; cd .. and
  11. # make <target> instead.
  12.  
  13. DEBUGCFLAGS=-g -DDEBUG -Wall -fomit-frame-pointer -pipe
  14. DEBUGLDFLAGS=-g
  15.  
  16. CC=gcc
  17.  
  18. # Where does the fortune program go?
  19. FORTDIR=/usr/games
  20. # Where do the data files (fortunes, or cookies) go?
  21. COOKIEDIR=/var/lib/games/fortunes
  22. # Offensive ones?
  23. OCOOKIEDIR=$(COOKIEDIR)/off
  24. # The ones with html tags?
  25. WCOOKIEDIR=$(COOKIEDIR)/html
  26. # Where do strfile and unstr go?
  27. BINDIR=/usr/sbin
  28. # What is the proper mode for strfile and unstr? 755= everyone, 700= root only
  29. BINMODE=0755
  30. #BINMODE=0700
  31. # Where do the man pages for strfile and unstr go?
  32. BINMANDIR=/usr/man/man8
  33. # What is their proper extension?
  34. BINMANEXT=8
  35. # And the same for the fortune man page
  36. FORTMANDIR=/usr/man/man6
  37. FORTMANEXT=6
  38. # Do we want to install the offensive files? (0 no, 1 yes)
  39. OFFENSIVE=1
  40. # Do we want to install files with html tags? (0 no, 1 yes)
  41. WEB=0
  42.  
  43. SUBDIRS=fortune util datfiles
  44.  
  45. .EXPORT_ALL_VARIABLES:
  46.  
  47. # By default, compile optimized versions
  48. all: fortune-bin util-bin cookies-z
  49.  
  50. # Create debugging versions
  51. debug: fortune-debug util-debug
  52.  
  53. # Just create the fortune binary
  54. fortune-bin:
  55.     $(MAKE) -C fortune
  56.  
  57. fortune-debug:
  58.     $(MAKE) -C fortune debug
  59.  
  60. util-bin:
  61.     $(MAKE) -C util
  62.  
  63. # Not listed in help
  64. randstr:
  65.     $(MAKE) -C util randstr
  66.  
  67. # Not listed in help -- made when cookies are made, if offensive.
  68. rot:
  69.     $(MAKE) -C util rot
  70.  
  71. util-debug:
  72.     $(MAKE) -C util debug
  73.  
  74. cookies:
  75.     @echo "Try the kitchen, silly!" ; sleep 3
  76.     @echo "Sorry, just joking."
  77.     $(MAKE) -C datfiles
  78.  
  79. cookies-z:
  80.     $(MAKE) -C datfiles
  81.  
  82. # Install everything
  83. install: install-fortune install-util install-man install-cookie
  84.  
  85. # Install just the fortune program
  86. install-fortune:
  87.     install -s -m 0755 fortune/fortune $(FORTDIR)
  88.  
  89. # Install just the utilities strfile and unstr
  90. install-util:
  91.     install -s -m $(BINMODE) util/strfile $(BINDIR)
  92.     install -s -m $(BINMODE) util/unstr $(BINDIR)
  93.  
  94. # Install all the man pages
  95. install-man: install-fman install-uman
  96.  
  97. # Install the fortune man pages
  98. # Note: this also concatenates the parts of the man page with the locally
  99. #       defined pathnames (which should reduce confusion).
  100. install-fman:
  101.     @cat fortune/fortune-man.part1 >fortune/fortune.man
  102.     @echo "$(COOKIEDIR) \- Directory for inoffensive fortunes" >>fortune/fortune.man
  103.     @echo ".br" >>fortune/fortune.man
  104.     @echo "$(OCOOKIEDIR) \- Directory for offensive fortunes" >>fortune/fortune.man
  105.     @cat fortune/fortune-man.part2 >>fortune/fortune.man
  106.     install -m 0644 -o man fortune/fortune.man $(FORTMANDIR)/fortune.$(FORTMANEXT)
  107.  
  108. # Install the utilities man pages
  109. install-uman:
  110.     install -m 0644 -o man mutil/strfile.man $(BINMANDIR)/strfile.$(BINMANEXT)
  111.     ln -s $(BINMANDIR)/strfile.$(BINMANEXT) $(BINMANDIR)/unstr.$(BINMANEXT)
  112.  
  113. # Install the fortune cookie files
  114. install-cookie:
  115.     $(MAKE) -C datfiles install
  116.  
  117. .PHONY: clean
  118. clean:
  119.     for i in $(SUBDIRS) ; do $(MAKE) -C $$i clean ; done
  120.  
  121. .PHONY: love
  122. love:
  123.     @echo "Not war?" ; sleep 3
  124.     @echo "Look, I'm not equipped for that, okay?" ; sleep 2
  125.     @echo "Contact your hardware vendor for appropriate mods."
  126.  
  127. .PHONY: help
  128. help:
  129.     @echo "Targets:"
  130.     @echo
  131.     @echo "all:    make all the binaries and data files (the default target)"
  132.     @echo " fortune-bin:    make the fortune binary"
  133.     @echo " util-bin:    make the strfile and unstr binaries"
  134.     @echo " cookies:    make the fortune-cookie data files"
  135.     @echo
  136.     @echo "debug:    make debugging versions of the binaries"
  137.     @echo " fortune-debug:    Just the fortune program"
  138.     @echo " util-debug:    Just strfile and unstr"
  139.     @echo
  140.     @echo "install:    install the files in locations specified in Makefile"
  141.     @echo " install-fortune:    Just the fortune program"
  142.     @echo " install-util:        Just strfile and unstr"
  143.     @echo " install-cookie:    Just the fortune string and data files"
  144.     @echo " install-man:        Just the man pages"
  145.     @echo "  install-fman:        Just the fortune man page"
  146.     @echo "  install-uman:        Just the strfile/unstr man page"
  147.     @echo
  148.     @echo "clean:    Remove object files and binaries"
  149.     @echo 
  150.     @echo "help:    This screen"
  151.     @echo
  152.     @echo "love:    What a *good* idea!  Let's!"
  153.